<!DOCTYPE html>
<html>
	<head>
		<title>element-cache</title>
		<link type='text/css' href='./css/assert.css' rel='stylesheet'/>
	</head>
	<body>
		<div>element 1</div>
		<div>element 2</div>
		<script type='text/javascript' src='./scripts/assert.js'></script>
		<script type='text/javascript' src='./scripts/elementCache.js'></script>
		<script>
			window.onload = function(){
			   var elements = document.getElementsByTagName( 'div' );
			   for( var i = 0; i < elements.length; i ++ ){
				getData( elements[ i ] ).html = elements[ i ].innerHTML;
			   }
			   for( var i = 0; i < elements.length; i ++ ){
				assert( getData( elements[ i ] ).html === elements[ i ].innerHTML, elements[ i ].innerHTML + ' it is the same ');
			   }
			   for( var i = 0; i < elements.length; i ++ ){
				removeData( elements[ i ] );
			   }
			   for( var i = 0; i < elements.length; i ++ ){
			        assert( getData( elements[ i ] ).html === undefined, elements[ i ].innerHTML + ' cached deleted' );
			   }
			}
		</script>
	</body>
</html>
